@import "./variables";

@font-face {
  font-family: "newfont"; //自定义文字名
  src: url("../font/newfont.ttf"); //路径引入文字
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "DINAlternateBold";
  src: url(../font/DINAlternateBold.ttf) format("truetype");
}

@font-face {
  font-family: "Digital-7Mono";
  src: url(../font/Digital-7Mono.TTF) format("truetype");
}

@font-face {
  font-family: "HYHeiFangJ";
  src: url(../font/HYHeiFangJ.ttf) format("truetype");
}

//  全局样式
* {
  margin: 0;
  padding: 0;
  list-style-type: none;
  box-sizing: border-box;
  outline: none;
}

html {
  font-size: 13px;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.2em;
  background-color: #f1f1f1;
  margin: 0;
  padding: 0;
}

a {
  color: #343440;
  text-decoration: none;
}

.clearfix {
  &::after {
    content: "";
    display: table;
    height: 0;
    line-height: 0;
    visibility: hidden;
    clear: both;
  }
}

//浮动
.float-r {
  float: right;
}

//浮动
.float-l {
  float: left;
}

.multiple-item-bg {
  background-image: url('../background/item_multiple_background.png');
  background-repeat: no-repeat;
  background-size: cover;
}

// 字体加粗
.fw-b {
  font-weight: bold;
}

//文章一行显示，多余省略号显示
.title-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.is-data-up {
  color:#FF4965;
}
.is-data-down {
  color: #44C787;
}
.bg-color-black {
  background-color: rgba(19, 25, 47, .6);
}

.bg-color-blue {
  background-color: #1A5CD7;
}

.grid-item {
  width: 100%;
  height: calc(105% + 0.06rem);
  // padding-left: 0.71875rem;
  // padding-top: 1.13125rem;
  .title {
    font-family: PingFangSC-Semibold;
    font-size: 1.6rem;
    color: #ffffff;
    margin-top: 2rem;
    position: relative;
    // margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: {
      color: #04A0FE;
      style: solid;
      width:0.3rem;
      radius: 1.5px;
    }
    letter-spacing: 0;
    .yearOrMonth {
      position: absolute;
      right: 2rem;
      top: -0.4rem;
    }
  }
  
}

.colorBlack {
  color: #272727 !important;

  &:hover {
    color: #272727 !important;
  }
}

.colorGrass {
  color: #33CEA0;

  &:hover {
    color: #33CEA0 !important;
  }
}

.colorRed {
  color: #ff5722;

  &:hover {
    color: #ff5722 !important;
  }
}

.colorText {
  color: #D3D6DD !important;

  &:hover {
    color: #D3D6DD !important;
  }
}

.colorBlue {
  color: #257dff !important;

  &:hover {
    color: #257dff !important;
  }
}


//颜色
@each $colorkey,
$color in $colors {
  .text-#{$colorkey} {
    color: $color;
  }

  .bg-#{$colorkey} {
    background-color: $color;
  }
}


//对齐
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var !important;
  }
}

//flex
@each $key,
$value in $flex-jc {
  .jc-#{$key} {
    justify-content: $value;
  }
}

@each $key,
$value in $flex-ai {
  .ai-#{$key} {
    align-items: $value;
  }
}

//字体
@each $fontkey,
$fontvalue in $font-sizes {
  .fs-#{$fontkey} {
    font-size: $fontvalue * $base-font-size;
  }
}


//.mt-1 => margin top
//spacing

@each $typekey,
$type in $spacing-types {

  //.m-1
  @each $sizekey,
  $size in $spacing-sizes {
    .#{$typekey}-#{$sizekey} {
      #{$type}: $size * $spacing-base-size;
    }
  }

  //.mx-1
  @each $sizekey,
  $size in $spacing-sizes {
    .#{$typekey}x-#{$sizekey} {
      #{$type}-left: $size * $spacing-base-size;
      #{$type}-right: $size * $spacing-base-size;
    }

    .#{$typekey}y-#{$sizekey} {
      #{$type}-top: $size * $spacing-base-size;
      #{$type}-bottom: $size * $spacing-base-size;
    }
  }

  //.mt-1
  @each $directionkey,
  $direction in $spacing-directions {

    @each $sizekey,
    $size in $spacing-sizes {
      .#{$typekey}#{$directionkey}-#{$sizekey} {
        #{$type}-#{$direction}: $size * $spacing-base-size;
      }
    }
  }

  .#{$typekey} {
    #{$type}: 0;
  }
}